package com.yq.day74.daili.dongtai;

import com.yq.day74.daili.jingtai.BuyFood;
import com.yq.day74.daili.jingtai.JingTian;

import java.lang.reflect.Proxy;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/04 16:36
 */
public class JDKProxyTest {
    public static void main(String[] args) {
        //    代理对象
        BuyFood proxy = (BuyFood) Proxy.newProxyInstance(JingTian.class.getClassLoader(),
                JingTian.class.getInterfaces(),
                new JingTianInvocationHandler());
        //
        proxy.buyBreakFast();

    }
}
